<?php

if (!defined('BASEPATH')) die('Access Denied.');

/**
 * µMVC Framework (c) 2011.
 * 
 * PHP5 MVC Framework software for PHP 5.2.17 or later
 * 
 * @package         µMVC
 * @filename        system/helpers/url.helper.php
 * @copyright       Lanz (c) 2011.
 * 
 */
/**
 * url Helper Functions
 * 
 * @package         µMVC
 * @subpackage      Helper
 * @category        System
 * 
 */

if (!function_exists('baseUrl'))
{
    /**
     * Returns the base url to the site, eg: http://www.site.com/.
     * 
     * @return string 
     */
    function baseUrl()
    {
        $config = \System\Core\Config::instance();
        return $config->getItem('base_url');
    }
}

if (!function_exists('anchor'))
{
    function anchor($link, $description)
    {
        $config = \System\Core\Config::instance();
        
        $anchor = '<a href="'.$config->getItem('base_url').$link.'">'.$description.'</a>';
        
        return $anchor;
    }
}

?>
